import React, { Component } from "react";
import classNames from "classnames";
import "./index.css";
export default class index extends Component {
  state = {
    flag: true,
  };
  render() {
    return (
      <>
        <h1>classnames类名控制</h1>
        <button className={classNames("btn", { 'active': this.state.flag })}>
          第一个
        </button>
      </>
    );
  }
}
